<!doctype html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<link rel="stylesheet" href="bootstrap.css">

	<title>容器和栅格系统</title>

	<style>
		.container {
			background-color: #d0c6b3;
		}

		.row {
			background-color: #89c296;
		}

		.row div {
			border: 1px solid #09444f;
			height: 80px;
			font-size: 26px;
		}
	</style>
</head>
<body>

<div class="container">
	<div class="row">
		<div class="col">1</div>
		<div class="col">2</div>
		<div class="col">3</div>
		<div class="col">4</div>
		<div class="col">5</div>
	</div>

	<div class="row mt-3">
		<div class="col-8">col-8</div>
		<div class="col-4">col-4</div>
	</div>
</div>

<!--sm: 浏览器宽 ≥ 576px 起作用-->
<div class="container mt-3">
  <div class="row">
    <div class="col-md-4 col-lg-3">col-sm</div>
    <div class="col-md-4 col-lg-3">col-sm</div>
    <div class="col-md-4 col-lg-3">col-sm</div>
    <div class="col-md-4 col-lg-3">col-sm</div>
  </div>
</div>

<!-- 把行分成 3 列 -->
<div class="container mt-3">
  <div class="row row-cols-2">
    <div class="col">Column</div>
    <div class="col">Column</div>
    <div class="col">Column</div>
    <div class="col">Column</div>
  </div>
</div>

<div class="container my-5">
  <div class="row row-cols-md-4">
    <div class="col">ColumnColumnColumnColumn</div>
    <div class="col">Column</div>
    <div class="col">Column</div>
    <div class="col">Column</div>
  </div>
</div>

<!-- 列偏移 -->
<div class="container my-5">
  <div class="row">
    <div class="col-md-4">
       .col-md-4
    </div>
    <div class="col-md-4 offset-md-4">
      .col-md-4 .offset-md-4
    </div>
  </div>
</div>

<!-- 嵌套 -->
<div class="container my-5">
	<div class="row">

		<div class="col">
			<div class="row">
				<div class="col">1</div>
				<div class="col">2</div>
				<div class="col">3</div>
			</div>
		</div>

		<div class="col">
			<div class="row">
				<div class="col-md-4">col-4</div>
				<div class="col-md-8">col-8</div>
			</div>
		</div>

	</div>
</div>

</body>
</html>